<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改计划人')" />
    <th:block th:include="include :: ztree-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-role-edit" th:object="${planner}">
        <!--<input id="routeId" name="routeId" type="hidden" th:field="*{routeId}"/>-->
        <div class="form-group">
            <label class="col-sm-3 control-label ">计划人标识：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" disabled name="buyerCode" id="buyerCode" th:field="*{buyerCode}" required  >
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">名称：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="buyerTitle" id="buyerTitle" th:field="*{buyerTitle}" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">标题：</label>
            <div class="col-sm-8">
                <input id="forwardAgentId" name="blockedForUse" class="form-control" th:field="*{blockedForUse}" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">日期：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="rowversion" id="rowversion" th:field="*{rowversion}" required>
            </div>
        </div>
        <!--<div class="form-group">-->
            <!--<label class="col-sm-3 control-label ">运输单位类型：</label>-->
            <!--<div class="col-sm-8">-->
                <!--<input class="form-control" type="text" name="checkOnLineLevel" id="checkOnLineLevel" required>-->
            <!--</div>-->
        <!--</div>-->
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: ztree-js" />
<script type="text/javascript">
    // $("#form-role-add").validate({
    //     rules:{
    //         onkeyup: false,
    //         routeId:{
    //             remote: {
    //                 url: ctx + "goodsPath/checkRouteId",
    //                 type: "post",
    //                 dataType: "json",
    //                 data: {
    //                     "routeId" : function() {
    //                         return $.common.trim($("#routeId").val());
    //                     }
    //                 },
    //                 dataFilter: function(data, type) {
    //                     return $.validate.unique(data);
    //                 }
    //             }
    //         },
    //     },
    //     messages: {
    //         "routeId": {
    //             remote: "工艺路线标识已经存在"
    //         }
    //     },
    //     focusCleanup: true
    // });
    function submitHandler() {
        // if ($.validate.form()) {
            edit();
        // }
    }

    function edit() {
        var buyerCode = $("input[name='buyerCode']").val();
        var buyerTitle = $("input[name='buyerTitle']").val();
        var blockedForUse = $("input[name='blockedForUse']").val();
        var rowversion = $("input[name='rowversion']").val();
        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "planner/edit",
            data : {
                "buyerCode": buyerCode,
                "buyerTitle": buyerTitle,
                "blockedForUse": blockedForUse,
                "rowversion": rowversion
            },
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }
</script>
</body>
</html>
